package cn.declare.service.impl;

import cn.declare.bean.Product;
import cn.declare.bean.Producttype;
import cn.declare.dao.ProductDao;
import cn.declare.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductDao productDao;
//产品情况
    @Override
    public List<Product> getProductList(int pageIndex, String productTypeName) {
        return productDao.getProductList(pageIndex,productTypeName);
    }

    @Override
    public int addProduct(Product product) {
        return productDao.addProduct(product);
    }

    @Override
    public Product getProductId(int productId) {
        return productDao.getProductId(productId);
    }

    @Override
    public int updateProduct(Product product) {
        return productDao.updateProduct(product);
    }

    @Override
    public int deleteProduct(int productId) {
        return productDao.deleteProduct(productId);
    }
//产品类型
    @Override
    public List<Producttype> getProductTypeList() {
        return productDao.getProductTypeList();
    }

    @Override
    public int addProductType(Producttype producttype) {
        return productDao.addProductType(producttype);
    }

    @Override
    public int updateProductType(Producttype producttype) {
        return productDao.updateProductType(producttype);
    }


    @Override
    public int deleteProductTypeId(int productTypeId) {
        return productDao.deleteProductTypeId(productTypeId);
    }


}

